/* 全局样式 - 可爱、温馨、浪漫风格 */

/* 重置默认样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  width: 100%;
  min-height: 100vh;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff9a9e 0%, #fecfef 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ff8a8e 0%, #febfdf 100%);
}

/* 主题色变量 */
:root {
  --primary-color: #ff9a9e;
  --primary-light: #fecfef;
  --secondary-color: #ffd1dc;
  --background-color: #ffeef8;
  --text-color: #333;
  --text-light: #666;
  --border-color: #ffe0ec;
  --shadow-color: rgba(255, 154, 158, 0.2);
  --success-color: #67c23a;
  --warning-color: #e6a23c;
  --danger-color: #f56c6c;
  --info-color: #909399;
}

/* 通用卡片样式 */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px var(--shadow-color);
  transition: all 0.3s;
}

.card:hover {
  box-shadow: 0 6px 16px var(--shadow-color);
  transform: translateY(-2px);
}

/* 通用按钮样式 */
.btn-primary {
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-color);
}

.btn-primary:active {
  transform: translateY(0);
}

/* 通用标题样式 */
.page-title {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 24px;
  text-align: center;
  position: relative;
  padding-bottom: 12px;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border-radius: 2px;
}

/* 通用输入框样式 */
.input-wrapper {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
}

/* Element Plus 组件样式覆盖 */
.el-button--primary {
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
  border: none;
}

.el-button--primary:hover {
  background: linear-gradient(90deg, #ff8a8e 0%, #febfdf 100%);
}

/* 卡片容器 */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 16px;
  color: var(--text-light);
}

/* 加载状态 */
.loading-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
}

/* 渐变背景 */
.gradient-bg {
  background: linear-gradient(135deg, #ffeef8 0%, #fff5f7 100%);
}

/* 爱心装饰 */
.heart-decoration {
  position: relative;
}

.heart-decoration::before {
  content: '💕';
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 20px;
  animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* 响应式设计 */

/* 移动端适配 (< 768px) */
@media (max-width: 768px) {
  html {
    font-size: 14px; /* 基础字体大小 */
  }

  body {
    -webkit-tap-highlight-color: transparent; /* 移除点击高亮 */
    -webkit-touch-callout: none; /* 禁用长按菜单 */
  }

  .card {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
  }

  .page-title {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .card-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* 移动端按钮优化 */
  .btn-primary,
  .el-button {
    min-height: 44px; /* iOS 推荐的最小点击区域 */
    padding: 12px 20px;
    font-size: 15px;
  }

  /* 移动端输入框优化 */
  .el-input__inner,
  .el-textarea__inner {
    font-size: 16px; /* 防止 iOS 自动缩放 */
    min-height: 44px;
  }

  /* 移动端对话框优化 */
  .el-dialog {
    width: 90% !important;
    margin: 0 auto;
  }

  .el-dialog__body {
    padding: 20px 15px;
  }

  /* 移动端表单优化 */
  .el-form-item {
    margin-bottom: 18px;
  }

  .el-form-item__label {
    font-size: 14px;
  }

  /* 移动端滚动条隐藏 */
  ::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
}

/* 小屏手机适配 (< 576px) */
@media (max-width: 576px) {
  html {
    font-size: 13px;
  }

  .card {
    padding: 12px;
    border-radius: 10px;
  }

  .page-title {
    font-size: 20px;
  }

  .btn-primary,
  .el-button {
    padding: 10px 16px;
    font-size: 14px;
  }
}

/* 平板适配 (768px - 992px) */
@media (min-width: 768px) and (max-width: 992px) {
  html {
    font-size: 15px;
  }

  .card-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .main-content {
    padding: 20px;
  }
}

/* 桌面端适配 (> 992px) */
@media (min-width: 992px) {
  html {
    font-size: 16px;
  }

  .card-container {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
  }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
  .page-title {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .card {
    padding: 12px;
  }
}

/* 安全区域适配（刘海屏等） */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* 动画效果 */
.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.3s;
}

.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

.slide-enter-active,
.slide-leave-active {
  transition: all 0.3s;
}

.slide-enter-from {
  transform: translateX(-20px);
  opacity: 0;
}

.slide-leave-to {
  transform: translateX(20px);
  opacity: 0;
}

/* 通用间距 */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.ml-10 { margin-left: 10px; }
.ml-20 { margin-left: 20px; }
.mr-10 { margin-right: 10px; }
.mr-20 { margin-right: 20px; }

/* 通用文本对齐 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 通用 Flex 布局 */
.flex { display: flex; }
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-column { display: flex; flex-direction: column; }

